package com.qdxwx.data.service.user;

import com.qdxwx.common.exception.AccountException;
import com.qdxwx.common.page.PageRequest;
import com.qdxwx.models.order.Order;
import com.qdxwx.models.user.User;
import com.qdxwx.models.user.UserInvite;

import jakarta.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
public interface UserInviteService {
	/**
     * 添加qdx_user_invites
     */
    int add(UserInvite userInvite) throws AccountException;

    /**
     * 通过id，查询qdx_user_invites
     */
    UserInvite get(long id);

    UserInvite getByInviteUserId(long userId);

    List<UserInvite> getList(UserInvite userInvite, PageRequest page);

    long count(UserInvite userInvite);
    /**
     * 分销消费 返现给邀请人
     */
    void orderCashback(HttpServletRequest request, Order order) throws AccountException;

    void finishReg(User user, HttpServletRequest request);

    void setSession(HttpServletRequest request);

    UserInvite getSession(HttpServletRequest request);

    int updateCombine(long userId1, long userId2);
}



